package com.itheima.dto;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.itheima.entity.SetmealDish;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

/**
 * @Author: zhuan
 * @Desc: 套餐模块-数据传输对象 DTO
 * @Date: 2022-05-21 14:20:53
 */
@Data
public class SetmealDTO implements Serializable {
		//注意：集合数据作为属性时，要初始化
		List<SetmealDish> setmealDishes = new ArrayList<>();

		@TableId(type= IdType.ASSIGN_ID)
		private Long id;

		//分类id
		private Long categoryId;

		//套餐名称
		private String name;

		//套餐价格
		private BigDecimal price;

		//状态 0:停用 1:启用
		private Integer status;

		//编码
		private String code;

		//描述信息
		private String description;

		//图片
		private String image;

		@JSONField(format = "yyyy-MM-dd HH:mm:ss")
		@TableField(fill = FieldFill.INSERT)
		private LocalDateTime createTime;

		@JSONField(format = "yyyy-MM-dd HH:mm:ss")
		@TableField(fill = FieldFill.INSERT_UPDATE)
		private LocalDateTime updateTime;


		@TableField(fill = FieldFill.INSERT)
		private Long createUser;


		@TableField(fill = FieldFill.INSERT_UPDATE)
		private Long updateUser;
}
